#ifndef REGIONSEARCH_H
#define REGIONSEARCH_H

#include "include/search.h"
#include "include/searchItem.h"

class QLabel;
class QComboBox;
class QPushButton;

class RegionSearchDlg : public Search
{
    Q_OBJECT

public:
    RegionSearchDlg(QWidget *parent = 0);

signals:
    void sendItemId(QString itemId);

private slots:
    void SearchItems();

private:
    QString BuildQuery();
    void CreateWidget();
    void CreateLayout();
    void UpdateSearchResult(const QString &sqlQuery);
    void mousePressEvent(QMouseEvent *);
    void timerEvent(QTimerEvent *event);
    void showEvent(QShowEvent *);

    int myTimerId;

    QComboBox *area;
    QComboBox *ridgepole;
    QComboBox *layer;
    QComboBox *room;
    QComboBox *devName;

    QLabel *areaLabel;
    QLabel *ridgepoleLabel;
    QLabel *layerLabel;
    QLabel *roomLabel;
    QLabel *devNameLabel;
    QLabel *tmpLabel;

    QPushButton *quit;

    SearchItem *item[NUM_OF_TOTAL_ITEM];

};

#endif // REGIONSEARCH_H
